import { roleList } from "../../../request/api";
//state
const state = {
  rolelist: [],
};
const getters = {
  getRole(state) {
    return state.rolelist;
  },
};
const mutations = {
  REQ_ROLELIST(state, payload) {
    state.rolelist = payload;
  },
};
const actions = {
  async getRoleListAction({ commit }) {
    let res = await roleList();
    // console.log(res,'角色列表');
    commit("REQ_ROLELIST", res.list);
  },
};

export default {
  state,
  getters,
  mutations,
  actions,
  namespaced: true,
};
